package org.bee.enums;

/**
 * 文件类型
 */
public enum FileType {
    IMAGES(0, "images","图片"),

    VIDEOS(1,"videos","视频"),

    DOC(2, "doc","Word文档"),

    EXCEL(3,"excel", "Excel文档"),

    PPT(4,"ppt","PPT文档"),

    PDF(5,"pdf","PDF文档"),

    MUSIC(6,"music","音乐"),

    TXT(7, "txt","txt"),

    OTHERS(9,"others","其他");


    private Integer code;
    private String rootPath;
    private String desc;

    FileType(Integer code,String rootPath, String desc) {
        this.rootPath = rootPath;
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getRootPath() {
        return rootPath;
    }

    public void setRootPath(String rootPath) {
        this.rootPath = rootPath;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
    public static String getCodeMean(Integer code) {
        for (FileType fileType : FileType.values()) {
            if (fileType.getCode().equals(code)) {
                return fileType.getDesc();
            }
        }
        return null;
    }
}
